import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_device_uuid/flutter_device_uuid.dart';
import 'package:flutter_device_uuid/flutter_device_uuid_platform_interface.dart';
import 'package:flutter_device_uuid/flutter_device_uuid_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterDeviceUuidPlatform
    with MockPlatformInterfaceMixin
    implements FlutterDeviceUuidPlatform {

  @override
  Future<String?> getDeviceUuid({String? iosStoreKey,}) => Future.value('42');
}

void main() {
  final FlutterDeviceUuidPlatform initialPlatform = FlutterDeviceUuidPlatform.instance;

  test('$MethodChannelFlutterDeviceUuid is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterDeviceUuid>());
  });

  test('getDeviceUuid', () async {
    FlutterDeviceUuid flutterDeviceUuidPlugin = FlutterDeviceUuid();
    MockFlutterDeviceUuidPlatform fakePlatform = MockFlutterDeviceUuidPlatform();
    FlutterDeviceUuidPlatform.instance = fakePlatform;

    expect(await flutterDeviceUuidPlugin.getDeviceUuid(), '42');
  });
}
